import request from '@/utils/request'
import { paramNoNull } from '@/utils/ParamFilter'

export function getMenuTree() {
  return request({
    url: '/admin/bee-manage/sys-menu/getMenuTree',
    method: 'get'
  })
}

export function getById(id) {
  return request({
    url: '/admin/bee-manage/sys-menu/' + id,
    method: 'get'
  })
}

export function editMenu(data) {
  return request({
    url: '/admin/bee-manage/sys-menu/edit',
    method: 'post',
    data: paramNoNull(data)
  })
}

export function addMenu(data) {
  return request({
    url: '/admin/bee-manage/sys-menu',
    method: 'post',
    data: paramNoNull(data)
  })
}
export function deleteById(id) {
  return request({
    url: '/admin/bee-manage/sys-menu/' + id,
    method: 'delete'
  })
}

export function page(data) {
  return request({
    url: '/admin/bee-manage/sys-menu/page',
    method: 'get',
    params: paramNoNull(data)
  })
}
